<template>
  <div>
    <!-- <h1>分类</h1> -->

    <div class="classHead">
      <div class="nav">
        <ul>
          <li :class="{ con: flag == 0 }" @click="flag = 0">
            <span @click="$router.push('/classification/boysClass')">男生</span>
          </li>

          <li :class="{ con: flag == 1 }" @click="flag = 1">
            <span @click="$router.push('/classification/girlsClass')"
              >女生</span
            >
          </li>

          <li :class="{ con: flag == 2 }" @click="flag = 2">
            <span @click="$router.push('/classification/pubClass')">出版</span>
          </li>
        </ul>
      </div>
    </div>

    <!-- 路由视图 -->
    <div class="btm">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: "class",
      flag: 0,
    };
  },
};
</script>

<style lang='less'>
.classHead {
  width: 100%;
  background-color: #f6f7f9;
  z-index: 1;
  position: fixed;
  top: 0;
  .nav {
    padding: 10px 15px;
    display: flex;
    width: 70%;
    margin: auto;
    ul {
      display: flex;
      align-items: baseline;
      padding: 5px 0;
      flex: 1;
      text-align: center;
      li {
        width: 33.3333%;
        color: #aaa;
        // border-bottom: 3px solid transparent;
        &::after {
          content: "";
          display: block;
          width: 20px;
          height: 3px;
          background-color: transparent;
          position: absolute;
          text-align: center;
          bottom: 8px;
          margin-left: 9%;
          border-radius: 4px;
        }
      }
      .con {
        font-size: 18px;
        color: #333;
        &::after {
          background-color: #333;
        }
      }
    }
    .iconfont {
      flex: 0 0 40px;
      text-align: center;
      line-height: 30px;
      font-size: 25px;
      color: #333;
      font-weight: 600;
    }
  }
}
</style>